home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 014 / unixgrep.arc / GREP.TXT < prev    next >
Encoding:
Text File  |  1986-12-29  |  1.6 KB  |  48 lines

  1.                                                 GREP.EXE
  2.  
  3.  
  4.                                                 Class: UNIX
  5.  
  6. Global Regular Expression Print
  7.  
  8. NAME
  9.     GREP                        Find occurences of regular expressions
  10.  
  11. SYNOPSIS
  12.     grep [-cfhlnvyz] <regular expression>[<regular expression>]... [<file>...]
  13.  
  14. DESCRIPTION
  15.     Grep is a Unix utility that permits the users to search a given set
  16.     of files for the occurence of various regular expression(s). A regular
  17.     expression is a text string that provides for the selection of very
  18.     specific strings in the text being searched.
  19.  
  20. OPTIONS
  21.     -c      count matching lines, no output for zero
  22.     -f      no regular expression given; file contains regular expressions
  23.     -h      no filename headers on lines
  24.     -l      list file names with match
  25.     -n      show line numbers
  26.     -v      show only lines that don't match
  27.     -z      count lines (even if if zero)
  28.  
  29.  
  30. EXAMPLES
  31.     The best way to learn how to use grep is to try it. Grep is written to
  32.     accept standard input (stdin) in lieu of a file. This permits grep to
  33.     use text piped from another program such as a compiler, linker etc and
  34.     select the desired lines.
  35.  
  36.             lc test.c | grep ^Warning,^Error
  37.  
  38.     This example will show any lines generated by the compiler that start
  39.     with either Warning or Error. Please note that grep is case sensitive.
  40.  
  41.             grep -f regexp *.c
  42.  
  43.     This example will look for all regular expressions listed in the file
  44.     regexp in all text files with .C as it's extent.
  45.  
  46.     Please refer to the text file on regular expressions for additional
  47.     examples.
  48.